home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_bas / t2win_32.zip / _DIB-BMP.FRM < prev    next >
Text File  |  1996-05-14  |  9KB  |  346 lines

  1. VERSION 4.00
  2. Begin VB.Form frmDIBBitmap 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "DIB & Bitmap"
  5.    ClientHeight    =   5685
  6.    ClientLeft      =   1725
  7.    ClientTop       =   1785
  8.    ClientWidth     =   7485
  9.    Height          =   6090
  10.    Left            =   1665
  11.    MaxButton       =   0   'False
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   5685
  14.    ScaleWidth      =   7485
  15.    ShowInTaskbar   =   0   'False
  16.    Top             =   1440
  17.    Width           =   7605
  18.    Begin VB.CommandButton Command1 
  19.       Caption         =   "Load"
  20.       Height          =   375
  21.       Left            =   6750
  22.       TabIndex        =   8
  23.       Top             =   2610
  24.       Visible         =   0   'False
  25.       Width           =   645
  26.    End
  27.    Begin VB.PictureBox Picture1 
  28.       AutoRedraw      =   -1  'True
  29.       Height          =   2985
  30.       Left            =   90
  31.       ScaleHeight     =   2925
  32.       ScaleWidth      =   7245
  33.       TabIndex        =   7
  34.       Top             =   2610
  35.       Width           =   7305
  36.    End
  37.    Begin VB.TextBox txt_Result 
  38.       BackColor       =   &H00C0C0C0&
  39.       BorderStyle     =   0  'None
  40.       Height          =   1845
  41.       Left            =   105
  42.       Locked          =   -1  'True
  43.       MultiLine       =   -1  'True
  44.       ScrollBars      =   2  'Vertical
  45.       TabIndex        =   0
  46.       Top             =   630
  47.       Width           =   7260
  48.    End
  49.    Begin Threed.SSPanel SSPanel1 
  50.       Align           =   1  'Align Top
  51.       Height          =   480
  52.       Left            =   0
  53.       TabIndex        =   1
  54.       Top             =   0
  55.       Width           =   7485
  56.       _Version        =   65536
  57.       _ExtentX        =   13203
  58.       _ExtentY        =   847
  59.       _StockProps     =   15
  60.       ForeColor       =   -2147483640
  61.       BackColor       =   12632256
  62.       Begin VB.ComboBox cmb_Function 
  63.          Height          =   315
  64.          Left            =   1365
  65.          TabIndex        =   2
  66.          Top             =   90
  67.          Width           =   4785
  68.       End
  69.       Begin Threed.SSCommand SSCommand1 
  70.          Default         =   -1  'True
  71.          Height          =   300
  72.          Left            =   6615
  73.          TabIndex        =   6
  74.          Top             =   90
  75.          Width           =   465
  76.          _Version        =   65536
  77.          _ExtentX        =   820
  78.          _ExtentY        =   529
  79.          _StockProps     =   78
  80.          Caption         =   "&Go"
  81.          BevelWidth      =   1
  82.          RoundedCorners  =   0   'False
  83.          Outline         =   0   'False
  84.       End
  85.       Begin VB.Label Label2 
  86.          Caption         =   "&Select a function"
  87.          Height          =   255
  88.          Left            =   90
  89.          TabIndex        =   5
  90.          Top             =   120
  91.          Width           =   1275
  92.       End
  93.       Begin Threed.SSCommand cmdNP 
  94.          Height          =   300
  95.          Index           =   0
  96.          Left            =   6300
  97.          TabIndex        =   4
  98.          Top             =   90
  99.          Width           =   255
  100.          _Version        =   65536
  101.          _ExtentX        =   450
  102.          _ExtentY        =   529
  103.          _StockProps     =   78
  104.          Caption         =   "<"
  105.          BevelWidth      =   1
  106.          Font3D          =   3
  107.          RoundedCorners  =   0   'False
  108.          Outline         =   0   'False
  109.       End
  110.       Begin Threed.SSCommand cmdNP 
  111.          Height          =   300
  112.          Index           =   1
  113.          Left            =   7140
  114.          TabIndex        =   3
  115.          Top             =   90
  116.          Width           =   255
  117.          _Version        =   65536
  118.          _ExtentX        =   450
  119.          _ExtentY        =   529
  120.          _StockProps     =   78
  121.          Caption         =   ">"
  122.          BevelWidth      =   1
  123.          Font3D          =   3
  124.          RoundedCorners  =   0   'False
  125.          Outline         =   0   'False
  126.       End
  127.    End
  128. End
  129. Attribute VB_Name = "frmDIBBitmap"
  130. Attribute VB_Creatable = False
  131. Attribute VB_Exposed = False
  132. Option Explicit
  133. Option Base 1
  134.  
  135. Private Const Iteration = 3
  136.  
  137. Dim IsLoaded         As Integer
  138.  
  139. Dim TimerStartOk     As Integer
  140. Dim TimerCloseOk     As Integer
  141.  
  142. Dim TimerHandle      As Integer
  143. Dim TimerValue       As Long
  144.  
  145. Private Sub cmdNP_Click(Index As Integer)
  146.  
  147.    Call sub_NextPrev(cmb_Function, Index)
  148.  
  149. End Sub
  150.  
  151.  
  152. Private Sub cmb_Function_Click()
  153.    
  154.    If (IsLoaded = False) Then Exit Sub
  155.    
  156.    Call cDisableFI(mdiT2W.Picture1)
  157.    
  158.    txt_Result = ""
  159.    
  160.    DoEvents
  161.    
  162.    Command1.Visible = False
  163.    Picture1.Width = 7305
  164.    
  165.    Select Case cmb_Function.ListIndex
  166.       Case 0
  167.          Call TestDIBSaveScreen
  168.       Case 1
  169.          Call TestDIBSaveWindow
  170.       Case 2
  171.          Picture1.Width = 6585
  172.          Command1.Visible = True
  173.          Call TestInstallHookKeyboard
  174.    End Select
  175.    
  176.    DoEvents
  177.    Call cEnableFI(mdiT2W.Picture1)
  178.    
  179. End Sub
  180.  
  181.  
  182. Private Sub Command1_Click()
  183.    If (cFilePathExists(T2WDirTest + "\TESTDIB.BMP") = True) Then
  184.       Picture1.Picture = LoadPicture(T2WDirTest + "\TESTDIB.BMP")
  185.    Else
  186.       MsgBox "File '" & T2WDirTest + "\TESTDIB.BMP" & "' not found"
  187.    End If
  188. End Sub
  189.  
  190. Private Sub Form_Activate()
  191.  
  192.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  193.  
  194. End Sub
  195.  
  196. Private Sub Form_Load()
  197.  
  198.    IsLoaded = False
  199.    
  200.    Show
  201.  
  202.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_dib-bmp.t2w")
  203.    
  204.    IsLoaded = True
  205.    
  206. End Sub
  207.  
  208.  
  209. Private Sub SSCommand1_Click()
  210.    
  211.    Call cmb_Function_Click
  212.    
  213. End Sub
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222. Private Sub TestDIBSaveWindow()
  223.    
  224.    Dim intResult        As Integer
  225.    Dim strResult        As String
  226.    Dim strDisplay       As String
  227.    Dim strFile          As String
  228.    
  229.    Dim i                As Integer
  230.    
  231.    strFile = T2WDirTest + "\snap_win.bmp"
  232.    
  233.    intResult = cDIBSaveWindow(Me.hWnd, DIB_SAVE_WINDOW, strFile)
  234.    
  235.    If (intResult = True) Then
  236.       strDisplay = strDisplay & "Active window has been saved" & vbCrLf & "in the file '" & strFile & "'" & vbCrLf & vbCrLf
  237.    Else
  238.       strDisplay = strDisplay & "Active window can't be saved" & vbCrLf & "in the file '" & strFile & "'" & vbCrLf & vbCrLf
  239.    End If
  240.    
  241.    txt_Result = strDisplay
  242.  
  243.    Picture1.Picture = LoadPicture(strFile)
  244.    
  245.    'time the function
  246.  
  247.    TimerHandle = cTimerOpen()
  248.    TimerStartOk = cTimerStart(TimerHandle)
  249.    
  250.    For i = 1 To Iteration
  251.       intResult = cDIBSaveWindow(Me.hWnd, DIB_SAVE_WINDOW, strFile)
  252.    Next i
  253.    
  254.    intResult = cKillFile(strFile)
  255.    
  256.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  257.    
  258.    TimerCloseOk = cTimerClose(TimerHandle)
  259.  
  260. End Sub
  261.  
  262. Private Sub TestDIBSaveScreen()
  263.    
  264.    Dim intResult        As Integer
  265.    Dim strResult        As String
  266.    Dim strDisplay       As String
  267.    Dim strFile          As String
  268.    
  269.    Dim i                As Integer
  270.    
  271.    strFile = T2WDirTest + "\snap_scr.bmp"
  272.    
  273.    intResult = cDIBSaveScreen(strFile)
  274.    
  275.    If (intResult = True) Then
  276.       strDisplay = strDisplay & "Screen has been saved" & vbCrLf & "in the file '" & strFile & "'" & vbCrLf & vbCrLf
  277.    Else
  278.       strDisplay = strDisplay & "Screen can't be saved" & vbCrLf & "in the file '" & strFile & "'" & vbCrLf & vbCrLf
  279.    End If
  280.    
  281.    txt_Result = strDisplay
  282.  
  283.    Picture1.Picture = LoadPicture(strFile)
  284.    
  285.    'time the function
  286.  
  287.    TimerHandle = cTimerOpen()
  288.    TimerStartOk = cTimerStart(TimerHandle)
  289.    
  290.    For i = 1 To Iteration
  291.       intResult = cDIBSaveScreen(strFile)
  292.    Next i
  293.    
  294.    intResult = cKillFile(strFile)
  295.    
  296.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  297.    
  298.    TimerCloseOk = cTimerClose(TimerHandle)
  299.  
  300. End Sub
  301.  
  302.  
  303.  
  304. Private Sub TestInstallHookKeyboard()
  305.    
  306.    Dim intResult        As Integer
  307.    Dim strResult        As String
  308.    Dim strDisplay       As String
  309.    Dim strFile          As String
  310.    
  311.    Dim i                As Integer
  312.    
  313.    intResult = cInstallHookKeyboard(True)
  314.    
  315.    If (intResult = True) Then
  316.       strDisplay = strDisplay & "InstallHookKeyboard has been successfully installed" & vbCrLf & vbCrLf
  317.    Else
  318.       strDisplay = strDisplay & "InstallHookKeyboard has been already installed" & vbCrLf & vbCrLf
  319.    End If
  320.    
  321.    strDisplay = strDisplay & "Press ALT+CTRL+SHIFT+F11 to save the screen" & vbCrLf
  322.    strDisplay = strDisplay & "Press ALT+CTRL+SHIFT+F12 to save the active window" & vbCrLf & vbCrLf
  323.    strDisplay = strDisplay & "For the test" & vbCrLf
  324.    strDisplay = strDisplay & "   don't change the directory" & vbCrLf
  325.    strDisplay = strDisplay & "   enter the name of the file TESTDIB" & vbCrLf
  326.    strDisplay = strDisplay & "   select a file type" & vbCrLf
  327.    strDisplay = strDisplay & "   push the OK button" & vbCrLf
  328.    strDisplay = strDisplay & "   push the LOAD command button" & vbCrLf
  329.    
  330.    txt_Result = strDisplay
  331.  
  332.    'time the function
  333.  
  334.    TimerHandle = cTimerOpen()
  335.    TimerStartOk = cTimerStart(TimerHandle)
  336.    
  337.    For i = 1 To Iteration
  338.       intResult = cInstallHookKeyboard(True)
  339.    Next i
  340.    
  341.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  342.    
  343.    TimerCloseOk = cTimerClose(TimerHandle)
  344.  
  345. End Sub
  346.